<h1><%=@business_title %> fundada el  <%=@foundation_date.day()%>-<%=@foundation_date.month() %>-<%=@foundation_date.year() %></h1>
<h2> Periodos contables</h2>

<table cellpadding="8">
  <tr>
  <% for column in Period.content_columns %>
    <th><%= column.human_name %></th>
  <% end %>
  </tr>
<%i=0%>  
<% for period in @periods %>
  <tr>
  <% for column in Period.content_columns %>
  
    <%if (column.name!="Valid") %>
        <td><%=h period.send(column.name) %></td>
    <%end%>    
    
  <% end %>
    <td>
    
    <%if period.valid=="NOT EVALUATED"%>
     <img src="/images/not_evaluated.jpg"/>
    <%elsif period.valid=="VALID"%>
     <img src="/images/valid.gif"/>
    <%elsif period.valid=="INVALID"%>
        <img src="/images/invalid.jpg"/>
    
    <%end%>
    

    
    
    </td>
    <td><%= link_to 'Libro diario', :controller => 'transaction1s', :action => 'index', :period=> period %></td>
    <td><%= link_to 'Libro mayor', :controller => 'transaction1s', :action => 'total_amount_period_transactions', :period=> period %></td>
    <td><%= link_to 'Estado de resultados',{:controller=>'transaction1s' ,:action => 'show_income_statement', :period => period }%></td>
    <td><%= link_to 'Balance general ', { :controller=>'transaction1s',:action => 'view_balance_sheet', :period => period }%>
    <td><%= link_to 'Validar', { :controller=>'transaction1s', :action => 'validate_period', :period=>period,:redirect=>'periods' } %></td>
  </tr>
  <%i=i+1%>
<% end %>
</table>
    
<%= link_to 'P&aacute;gina anterior', { :page => @period_pages.current.previous } if @period_pages.current.previous %>
<%= link_to 'siguiente p&aacute;gina', { :page => @period_pages.current.next } if @period_pages.current.next %> 

<br />

<%= link_to 'Nuevo periodo', :action => 'new' %>
<br /><br />
<i>Otras opciones</i>
<br/ ><br />


<p><%= link_to 'PUC', :controller=>'accounts', :action=>'list' %></p>
<p><%= link_to 'Empresa', :controller=>'configurations', :action=>'list' %></p>

